<?php $this->load->view('header'); ?>

<?php
        if($msg = $this->session->flashdata('flash_message'))
        {
            showMessage($msg['type'],$msg['msg']);
        }
		//Get Project Info
     	$project = $projects->row();
?>

<div class="wrap-content wrap-content-app wrap-project">
<div class="container">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12  profile-user">
    <div class="left-detail-project col-lg-8 col-md-8 col-sm-8">
        <p class="x8-24-b"><?php echo $project->project_name; ?></p>
        <div class="col-lg-12 col-md-12 col-xs-12 col-sm-12 reviews">
            <div class="col-lg-3 col-sm-3 col-md-3 col-xs-12">
                <p class="x8-16">Đang bid</p>
                <span class="x8-19-b num-bid"><?php echo getNumBid($project->id);?></span>
            </div>
            <div class="col-lg-3 col-sm-3 col-md-3 col-xs-12">
                <p class="x8-16">Giá trung bình</p>
                <span class="x8-19-b">$168</span>
            </div>
            <div class="col-lg-3 col-sm-3 col-md-3 col-xs-12">
                <p class="x8-16"><?php echo $this->lang->line('Budget'); ?></p>
                <span class="x8-19-b"><?php if ($project->budget_min != '0') echo '$ ' . $project->budget_min; else echo 'N/A'; ?> - <?php if ($project->budget_max != '0') echo '$ ' . $project->budget_max; else echo 'N/A'; ?></span>
            </div>
            <div class="col-lg-3 col-sm-3 col-md-3 col-xs-12">
                <p class="x8-16">Hạn chót bid</p>
                <span class="x8-19-b">6 ngày nữa</span>
            </div>
        </div>
        <div class="desc-detail-project col-lg-12 col-sm-12 col-md-12 col-xs-12">
            <div class="col-lg-12 col-sm-12 col-md-12 x8-16-b"><?php echo $this->lang->line('Description'); ?>:</div>
            <div class="col-lg-12 col-sm-12 col-md-12">
                <?php echo nl2br($project->description); ?>
            </div>
        </div> <!-- desc-detail-project -->
        <div class="skill-detail-project col-lg-12 col-sm-12 col-md-12 col-xs-12 margin-top-bottom">
            <div class="col-lg-12 col-sm-12 col-md-12 x8-16-b">Kỹ năng:</div>
            <div class="col-lg-12 col-sm-12 col-md-12 xanh-15">
                <?php echo getCategoryLinks($project->project_categories); ?>
            </div>
        </div>
    </div> <!-- left-detail-project -->
    <div class="right-detail-project col-lg-4 col-md-4 col-sm-4 col-xs-12">
        <div class="col-lg-12 col-sm-12 col-md-12 info-user">
            <div class="col-lg-4 col-sm-4 col-md-4 col-xs-12">
                <a class="thumbnail" href="#"><img src="http://placehold.it/400x300" class="img-responsive"></a>
            </div>
            <div class="col-lg-8 col-sm-8 col-md-8">
                <p><?php echo $project->user_name;?></p>
            </div>
        </div>
        <div class="arrow-up">
        </div>
        <div class="col-lg-12 col-md-12 col-sm-12  reviews">
            <p class="col-lg-12 col-md-12 col-sm-12   x8-20-b">Khiếu nại</p>
            <p class="col-lg-12 col-md-12 col-sm-12  x8-40-b">0/5</p>
            <div class="col-lg-12 col-md-12 col-sm-12">
                <input id="preview-user" value="0" type="number" data-star-captions="{}" data-default-caption="{rating}" class="rating" min=0 max=5  data-size="xs" >
            </div>
            <p class="reviews-user xanh-15">( 0 reviews)</p>
            <p class="salary-user"><span class="x8-16">Chi tiêu: </span><span class="x8-20-b">$5324</span></p>
        </div> <!-- reviews -->
        <div class="col-lg-12 col-sm-12 col-md-12">
            <a href="#" class="xanh-15">Báo cáo vi phạm</a>
        </div>
    </div> <!-- right-detail-project -->
</div> <!-- profile-user -->
<?php
    if(isProgrammer()){
?>
    <div class="col-lg-12 col-xs-12 bid no-padding-left col-sm-12 col-md-12">
<?php
        $bid = $bid->row();
        if (is_object($bid))
            $this->load->view('project/editBid');
        else
            $this->load->view('project/postBid');
?>
    </div> <!-- bid -->
<?php
    }
?>
<div class="public-message-board col-lg-12 col-md-12 col-sm-12 col-xs-12 no-padding margin-top-bottom">
    <textarea class="form-control" name="">Public message board</textarea>
</div> <!-- public-message-board -->
<div class="col-lg-3 col-xs-12 col-md-12 col-sm-12 col-lg-offset-9 no-padding">
    <button type="button" onclick="window.location = '<?php echo site_url('project/create')?>'" class="btn btn-primary btn-lg btn-block">Đăng một dự án giống vậy</button>
</div>
<div class="col-lg-12 col-sm-12 col-md-12 col-xs-12" id="list-freelancer-bid">
    <?php $this->load->view('project/listFreelancerBid');?>
</div> <!--list-freelancer-bid-->

</div> <!-- end row content -->
</div>
</div> <!-- wrap-content -->
</div>
<!--END OF POST PROJECT-->
<?php $this->load->view('footer'); ?>
